<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <script src="./js/vue.js"></script>
</head>

<body>
  <div id="root">
    ￥<input type="text" v-model="rmb"><br><br>
    ＄<input type="text" v-model="doller"><br><br>
    <h3>{{rmb}}人民币={{doller}}美元</h3>
  </div>


</body>
<script>
  Vue.config.productionTip = false
  const USD = 6.8
  new Vue({
    el: "#root",
    data() {
      return {
        rmb: '',
        doller: ''
      }
    },
    watch: {
      rmb(val) {
        this.doller = val / USD
      },
      doller(val) {
        this.rmb = val * USD

      }
    }


  })
</script>

</html>